From afd2aabff9de41e82042ce23896876ea462b4ed5 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 14 Dec 2006 15:43:40 +0000 Subject: [PATCH] [XEN] Fix memory allocator after recent bootmem change. Signed-off-by: Keir Fraser --- xen/common/page_alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 4365675a31..89cc140cf1 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -295,7 +295,7 @@ static DEFINE_SPINLOCK(heap_lock); void end_boot_allocator(void) { unsigned long i, j, k; - int curr_free = 0, next_free = 0; + int curr_free, next_free; memset(avail, 0, sizeof(avail)); @@ -305,6 +305,8 @@ void end_boot_allocator(void) INIT_LIST_HEAD(&heap[i][j][k]); /* Pages that are free now go to the domain sub-allocator. */ + if ( (curr_free = next_free = !allocated_in_map(first_valid_mfn)) ) + map_alloc(first_valid_mfn, 1); for ( i = first_valid_mfn; i < max_page; i++ ) { curr_free = next_free; -- 2.30.2